package org.wattdepot.simulation.core;

/**
 * Defines a Data object.
 * 
 * @author BaoHuy Ung, Alan Lee, Edwin Lim, and Anthony Xu.
 * 
 */
public abstract class Simulation {

  /**
   * Constructs a dorm object.
   */
  public Simulation() {
    // empty constructor
  }

  /**
   * Checks to see if m_Random is set.
   * 
   * @return boolean if m_random is set.
   */
  public abstract boolean isSet();

  /**
   * Returns true.
   * 
   * @return true
   */
  public abstract boolean isValid();

  /**
   * Generates a random power value.
   * 
   * @return power value
   */
  public abstract float createRandomValue();

  /**
   * Returns power in bits.
   * 
   * @return power in bits.
   */
  public abstract int getIntBits();

  /**
   * Converts to int bits.
   * 
   * @param x Input float to be converted.
   */
  public abstract void setIntBits(float x);
  
  /**
   * Accumulated energy value as float returned.
   * 
   * @return int bits of the float sum.
   */
  public abstract int getEnergyBits();
  
  /**
   * Convert float to int-bits and stored until called.
   * 
   * @param x the sum of accumulated energy.
   */
  public abstract void setEnergyBits(float x);

  /**
   * Returns energy value.
   * 
   * @return energy value.
   */
  public abstract int getEnergy();

  /**
   * Sets the energy value.
   * 
   * @param a The energy value.
   */
  public abstract void setEnergy(int a);
  
  /**
   * Returns latest energy data from WattDepot server.
   * 
   * @return WattDepot server energy data.
   */
  public abstract int getServerEnergy();
  
  /**
   * Sets the latest energy data from WattDepot server.
   * 
   * @param a latest WattDepot server energy.
   */
  public abstract void setServerEnergy(int a);
  
  /**
   * Sets the latest energy data from WattDepot server as float.
   * 
   * @param a latest WattDepot server energy.
   */
  public abstract void setEnergyFloat(double a);
  
  /**
   * Return latest energy data from WattDepot server.
   * 
   * @return WattDepot server energy data.
   */
  public abstract float getEnergyFloat();
  /**
   * Returns the limit.
   * 
   * @return Limit value.
   */
  public abstract int getLimit();

  /**
   * Sets the limit value.
   * 
   * @param a The limit value.
   */
  public abstract void setLimit(int a);

  /**
   * Computes the total energy used.
   * 
   * @param powerBitValue The randomly generated power level.
   * @return The energy value.
   */
  public abstract float totalAccumulatedEnergy(int powerBitValue);

  /**
   * Generates a random value for the Potential Transformer #1.
   * 
   * @return Potential Transformer #1 data.
   */
  public abstract float createRandomPT1Value();

  /**
   * Returns the Potential Transformer #1 value in bits.
   * 
   * @return Potential Transformer #1 value in bits.
   */
  public abstract int getBitsForPT();

  /**
   * Sets the Potential Transformer #1 value in bits.
   * 
   * @param x Potential Transformer #1 value to be converted to bits.
   */
  public abstract void setBitsForPT(float x);

  /**
   * Generates a random value for the Potential Transformer #2.
   * 
   * @return Potential Transformer #2 data.
   */
  public abstract int createRandomPT2Value();

  /**
   * Returns the Potential Transformer #2 value in bits.
   * 
   * @return Potential Transformer #2 value in bits.
   */
  public abstract int getPT2();

  /**
   * Sets the Potential Transformer #2 value in bits.
   * 
   * @param x Potential Transformer #2 value in bits.
   */
  public abstract void setPT2(int x);

  /**
   * Generates a random value for the Current Transformer #1.
   * 
   * @return Current Transformer #1 data.
   */
  public abstract int createRandomCT1Value();

  /**
   * Generates a random value for the Current Transformer #2.
   * 
   * @return Current Transformer #2 data.
   */
  public abstract int createRandomCT2Value();

}
